home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / par230.zip / POM.INF < prev    next >
Text File  |  1993-01-06  |  18KB  |  503 lines

  1. ===============================================================================
  2. ==========================                         ============================
  3. ==========================      PARSE-O-MATIC      ============================
  4. ==========================                         ============================
  5. ===============================================================================
  6.  
  7.  
  8.  
  9.  
  10.                       Parse-O-Matic is Copyright (C) 1992
  11.  
  12.                                       by
  13.  
  14.          Pinnacle Software, CP 386 Mount Royal, Quebec Canada  H3P 3C6
  15.          U.S. Office: Box 714 Airport Road, Swanton, Vermont 05488 USA
  16.  
  17.          Support Line (514) 345-9578  -- Free Files BBS (514) 345-8654
  18.                       
  19.  
  20.          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  21.  
  22.  
  23.          This is a SHAREWARE product.  That means we would like you to
  24.          pass around unregistered copies to other people.  If you have
  25.          a modem,  please upload it to your  favourite  bulletin board
  26.          system,  or give a copy to a friend  who you think might need
  27.          a program like this.   Shareware means sharing!   Pass it on!
  28.     
  29.                       
  30.          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  31.  
  32.                                         
  33.                      Design and coding: Timothy Campbell
  34.  
  35.                              Marketing: James Ludwick
  36.                                         Paul Renault
  37.  
  38.                          Documentation: Natasha Mirage
  39.  
  40.                           Distribution: Kevin Beck
  41.  
  42.                       Support services: L. Wilson
  43.                                         Z. Krome
  44.                                         P. Katt
  45.  
  46.  
  47.  
  48.  
  49. ===============================================================================
  50. INTRODUCTION
  51. ===============================================================================
  52.  
  53.  
  54.  
  55. WHY YOU NEED PARSE-O-MATIC
  56. --------------------------
  57.  
  58. There are  plenty  of programs out there that have  valuable  data locked  away
  59. inside them.  How do you get that data OUT of one program and into another one?
  60.  
  61. Some  programs  provide  a feature which  "exports"  a file into  some  kind of
  62. generic format.   Perhaps the  most popular  of  these  formats  is  known as a
  63. "comma-delimited file",  which is  a  text file  in which each  data  field  is
  64. separated by a  comma.   Literal strings -- which might  contain commas! -- are
  65. represented in double quotes.  So a few lines from a comma-delimited file might
  66. look something like this  (an export from a hypothetical database of people who
  67. owe your company money):
  68.  
  69.       +----------------------------------------------------------------+
  70.       | "JONES","FRED","1234 GREEN AVENUE", "KANSAS CITY", "MO",293.64 |
  71.       | "SMITH","JOHN","2343 OAK STREET","NEW YORK","NY",22.50         |
  72.       | "WILLIAMS","JOSEPH","23 GARDEN CRESCENT","TORONTO","ON",16.99  |
  73.       +----------------------------------------------------------------+
  74.  
  75. Unfortunately,  not  all  programs  export  data  in  this  format, and not all
  76. programs  READ  data in that format.   What's most  annoying of all is when one
  77. program exports data in a format that is ALMOST what you need!
  78.  
  79. If  that's  the case,  you might find that it's worth your while to spend a few
  80. hours in a text editor,  modifying  the export file  so that  the other program
  81. can understand it.   Or you  might  write a program  to do the editing for you.
  82. Both solutions are time-consuming.
  83.  
  84. An even  more  challenging  problem  arises  when a program which has no export
  85. capability DOES have the ability to "print" reports to a file.  You can write a
  86. program to read these files and convert them to something you can use, but this
  87. can be a LOT of work!
  88.  
  89.  
  90.  
  91. PARSE-O-MATIC TO THE RESCUE!
  92. ----------------------------
  93.  
  94. Parse-O-Matic  is a  utility  that  interprets text files  and converts them to
  95. other formats.  It can help you "boil down" reports  into their essential data.
  96. You can also use it to convert NEARLY compatible file formats.
  97.  
  98.  
  99.  
  100. HOW IT WORKS
  101. ------------
  102.  
  103. You need three things:
  104.  
  105.   1)  The Parse-O-Matic program
  106.   2)  A Parse-O-Matic "POM" file (to tell Parse-O-Matic what to do)
  107.   3)  The input file
  108.  
  109. The input file is  usually  a report  from   another  program.   We've provided
  110. several examples of typical input files.   For example,  the file  EXAMPLE2.TXT
  111. comes from the AccPac accounting software.  AccPac is a great program,  but its
  112. export capabilities leave something to be desired.  Parse-O-Matic can help!
  113.  
  114.  
  115.  
  116. ===============================================================================
  117. HOW TO CODE THE POM FILE
  118. ===============================================================================
  119.  
  120.  
  121. This documentation assumes that you are an experienced computer user.  If you
  122. have trouble, you might ask a programmer to help you -- POM file creation is
  123. a little like programming!
  124.  
  125.  
  126.  
  127. THE PARSE-O-MATIC COMMAND
  128. -------------------------
  129.  
  130. The format of the Parse-O-Matic command line is:
  131.  
  132.   POM pom-file input-file output-file
  133.  
  134. Here's an example, as you would type it at the DOS command line:
  135.  
  136.   POM POMFILE.POM REPORT.TXT OUTPUT.TXT
  137.  
  138. For a more formal description of the command line, start up POM by typing this
  139. command at the DOS prompt:
  140.  
  141.   POM
  142.  
  143.  
  144.  
  145. THE POM FILE
  146. ------------
  147.  
  148. The POM file is a text file with a .POM extension.  The following conventions
  149. are used when interpreting the POM file:
  150.  
  151. - Null lines and lines starting with a semi-colon are ignored.
  152.  
  153. - A POM file may contain up to 500 lines of specifications.
  154.   Comment lines do not count in this total.
  155.  
  156. A POM file contains no "loops" (to use the programming term).  Each line of the
  157. input file is processed by the entire POM file.   If you'd like it expressed in
  158. terms of programming languages, here's what POM does:
  159.  
  160.      +----------------------------------------------------------------+
  161.      | START:  If there's nothing left in the input file, go to QUIT. |
  162.      |         Read a line from the input file                        |
  163.      |         Do everything in the POM file                          |
  164.      |         Go to START                                            |
  165.      | QUIT:   Tell the user you're finished!                         |
  166.      +----------------------------------------------------------------+
  167.  
  168.  
  169.  
  170. PADDING FOR CLARITY
  171. -------------------
  172.  
  173. Spaces and tabs between the words and variables in a POM file line are
  174. generally ignored (except in the case of the OUT and OUTEND commands).  You
  175. can use spaces to make the POM file easier to read.
  176.  
  177. Additionally, in any line in the POM file, the following terms are ignored:
  178.  
  179.   =     THEN     ELSE
  180.  
  181. These can be added to make the lines easier to read.  For example, the IF
  182. command can be written in any of the following ways:
  183.  
  184.   Very terse:          IF PRICE "0.00" BONUS "0.00" "1.00"
  185.  
  186.   Padded with spaces:  IF PRICE   "0.00"   BONUS   "0.00"   "1.00"
  187.  
  188.   Fully padded:        IF PRICE = "0.00"  THEN  BONUS = "0.00"  ELSE  "1.00"
  189.  
  190.  
  191.  
  192. COMMAND WORDS
  193. -------------
  194.  
  195. For ease of learning, the commands words are presented in the following order:
  196.  
  197.     MINLEN  SET  IGNORE  ACCEPT  IF  TRIM  PAD  INSERT  CHANGE  OUT  OUTEND
  198.  
  199.  
  200. MINLEN number
  201.  
  202.     Specifies the minimum length a line must be to be considered for parsing.
  203.     (Note that null lines in the input file are always ignored)  If you omit
  204.     the MINLEN command, the minimum length is assumed to be  1.  That is to
  205.     say, all lines longer than 1 character will be processed.
  206.  
  207.     MINLEN is useful for ignoring brief information lines that clutter up a
  208.     report that you are parsing.  For example, in the sample file EXAMPLE2.POM,
  209.     the MINLEN command is set to 85 to ensure that all lines shorter than 85
  210.     characters long will be ignored.  This simplifies the coding considerably.
  211.  
  212.  
  213. SET var1 value1
  214.  
  215.     This assigns a value to a variable.  The usual reason to do this is to
  216.     set a variable from the input line ($FLINE) prior to cleaning it up wit